Transliterate
Transliterate
Convert text to best approximation in a different script Handle srcHandle ; handle to original text Handle destHandle ; handle for destination short target ; value indicating new script long srcMask ; value of source scripts to be converted
returns short; 0= noErr
Transliterate gives a best guess transliteration from one script system (such as the Roman alphabet) to another script system (such as Kanji)
srcHandle shows which script system was originally used for the text.
destHandle shows which script system will be used after transliteration .
target is the actual new script system. A value of -1 indicates the system script. The low byte is the new format, the high byte contains
modifiers which vary from script to script, as in the following
predefined constants:
smTransAscii = 0 Target is Roman script
smTransNative = 1 Target is non-Roman script
smTransCase = 2 Switch case for any target
smTransLower = 16384 Target become lowercase
smTransUpper = 32768 Target becomes uppercase
smMaskAscii = 1 Convert only Roman script
smMaskNative = 2 Convert only non-Roman script
smMaskAll = -1 Convert all text
scrMask is used to specify which characters in the source are to be converted
in cases where you don't want to transliterate every character in a
block of text.
Returns: a short that will be either: 0 for noErr; or a -1 meaning that transliteration could not be performed.
Notes: This procedure is used on completely Roman systems to change whole
blocks of text from upper- to lowercase and vice versa. In such a situation,
the value of srcMask would be smMaskAll (-1) and target would be smTransUpper+smTransAscii (32768+1).